package net.wofly.sale.activity.util;


/**
 * 活动类型内容
 *
 * @author lign
 * @version 1.0
 * @created 01-12月-2017 20:44:15
 */
public enum ActivityContent {
    赠品(1, "赠品"),
    打折(2, "打折");
    
    private Integer value;
    private String name;
    
    private ActivityContent(Integer value, String name) {
        this.value = value;
        this.name = name;
    }
    
    public static boolean isValueCorrect(Integer value) {
        for (ActivityContent forEnum : values()) {
            if (value == forEnum.getValue().intValue()) {
                return true;
            }
        }
        return false;
    }
    
    public static String getName(Integer value) {
        for (ActivityContent forEnum : values()) {
            if (value.equals(forEnum.getValue())) {
                return forEnum.name;
            }
        }
        return null;
    }
    
    public String getName() {
        return name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    public Integer getValue() {
        return value;
    }
    
    public void setValue(Integer value) {
        this.value = value;
    }
}